package cn.demoncat.util.zookeeper.constant;

import java.util.HashMap;
import java.util.Map;

import cn.demoncat.util.lang.constant.StringConstant;

/**
 * Zookeeper服务端常量
 * 
 * @author 延晓磊
 *
 * @since 2018年11月6日
 */
public class ServerConstant {

	/**
	 * 服务端模式
	 * 
	 * @author 延晓磊
	 *
	 * @since 2018年11月6日
	 */
	public static final class Mode{
		public static final String LEADER = "leader";
		public static final String FOLLOWER = "follower";
		public static final String STANDALONE = "standalone";
		
		public static final Map<String, String> MAP = new HashMap<String, String>(){
			private static final long serialVersionUID = 1L;
		{
			put(StringConstant.EMPTY, StringConstant.EMPTY);
			put(LEADER, "主");
			put(FOLLOWER, "从");
			put(STANDALONE, "单机");
		}};
	}
 
	/**
	 * 服务端状态
	 * 
	 * @author 延晓磊
	 *
	 * @since 2018年11月6日
	 */
	public static final class Status{
		
		//在线
		public static final String ONLINE = "ONLINE";
		//离线
		public static final String OFFLINE = "OFFLINE";
		//异常
		public static final String EXCEPTION = "EXCEPTION";
		
		public static final Map<String, String> MAP = new HashMap<String, String>(){
			private static final long serialVersionUID = 1L;
		{
			put(ONLINE, "在线");
			put(OFFLINE, "离线");
			put(EXCEPTION, "异常");
		}};
	}
	
	 
}
